package com.usian.order.controller;

import com.usian.order.model.Order;
import com.usian.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author baimugudu
 * @email 2415621370@qq.com
 * @date 2023/8/11 14:50
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    OrderService orderService;

    /**
     * 下订单的接口
     * @param order
     * @return
     */
    @PostMapping("/createOrder")
    public String createOrder(@RequestBody Order order){
        orderService.createOrder(order);
        return "OK";
    }

}
